package com.gestion.abs.web.actions;

import java.util.Date;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.gestion.abs.bll.api.GestionAbsence;
import com.gestion.abs.bo.Absence;
import com.gestion.abs.bo.Classe;
import com.gestion.abs.bo.Etudiant;
import com.gestion.abs.bo.Matiere;


public class AbsenceAction {
	
	
	private String senace;
	private Boolean justification;
	private Date dateAbsence;
	
	private GestionAbsence gestionAbsence;
	
	
	public String test(){
		
		ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");
		
		gestionAbsence=(GestionAbsence) context.getBean("gestionAbsence");
		
		try {
			
		
			Absence absence=new Absence("senace", true, new Date(), null,null);
			gestionAbsence.addAbsence(absence);
			System.out.println("coucouuuuuuuuuuuuu!");
			
		} catch (Exception e) {
			return "error";
		}
		
		return "success";
	}
	public String getSenace() {
		return senace;
	}
	public void setSenace(String senace) {
		this.senace = senace;
	}
	public Boolean getJustification() {
		return justification;
	}
	public void setJustification(Boolean justification) {
		this.justification = justification;
	}
	public Date getDateAbsence() {
		return dateAbsence;
	}
	public void setDateAbsence(Date dateAbsence) {
		this.dateAbsence = dateAbsence;
	}
	public GestionAbsence getGestionAbsence() {
		return gestionAbsence;
	}
	public void setGestionAbsence(GestionAbsence gestionAbsence) {
		this.gestionAbsence = gestionAbsence;
	}
	
	
public static void main(String[] args) {
	AbsenceAction abs=new AbsenceAction();
	
	abs.test();
}
}
